home *** CD-ROM | disk | FTP | other *** search
- /* scrmode.c */
- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- #include <sys/iocs.h>
-
-
- int main (int argc, char *argv[])
- {
- int sp;
- int old_crtmod;
- int i;
- static unsigned short crtcdata[9] =
- {69, 6, 11 + 8, 59 - 8, 567, 5, 40, 552, 0x0111};
- unsigned short *d;
-
-
- printf ("起動時はこの画面モードです\n何かキーを押して下さい\n");
- getche ();
-
-
-
- /* 256x256ドット 31kHz 256色モードに */
- old_crtmod = _iocs_crtmod (-1); /* 前の CRTMOD を保存 */
- _iocs_crtmod (10); /* 256x256dot 31kHz 256色 */
- _iocs_g_clr_on (); /* 一応 */
-
- printf ("256x256ドット 31kHz 256色モードにしました\n何かキーを押して下さい\n");
- getche ();
-
-
-
- /* 256x256 正方形モードを作る */
- sp = _iocs_b_super (0);
- *(unsigned short *) 0xe80028 = crtcdata[8];
- d = (unsigned short *) 0xe80002;
- for (i = 1; i < 8; i++)
- *d++ = crtcdata[i];
- *(unsigned short *) 0xe80000 = crtcdata[0];
-
- *(unsigned short *) 0xe8e006 |= 0b10; /* HRL ビット */
- *(unsigned short *) 0xeb080c = crtcdata[2] + 4;
- *(unsigned short *) 0xeb080a = crtcdata[0]; /* スプライト */
- *(unsigned short *) 0xeb080e = crtcdata[6];
- *(unsigned int *) 0xe80018 = *(unsigned int *) 0xe8001c
- = *(unsigned int *) 0xe80020 = *(unsigned int *) 0xe80024
- = (0 << 16) + 0; /* グラフィック画面の座標 */
-
- *(unsigned short *) 0xe82500 = 0b01001001001110; /* 優先順位 TX>SP>GR */
- _iocs_b_super (sp);
-
- printf ("\n\n256x256ドット 31kHz 256色・正方形モードにしました\n何かキーを押して下さい\n");
- getche ();
-
-
-
- /* 元の画面モードに戻す */
- sp = _iocs_b_super (0);
- *(unsigned short *) 0xe8e006 &= 0xfffd; /* HRL ビットを元に戻す */
- _iocs_b_super (sp);
- _iocs_crtmod (old_crtmod);
- printf ("元の画面モードに戻しました\n");
-
-
- return (0);
- }
-